#include <mpi.h>
#include "halofinder.h"

/* global vars are defined here except those in 
   profile.c
*/

/* extern defs of global vars in globalvars.c */
HaloFinderData haloFinderData;                /* global struct with all vars from config file */
int ThisTask;                                 /* this task's rank in MPI_COMM_WORLD */
int NTasks;                                   /* number of tasks in MPI_COMM_WORLD */
int NumDomains[3];                            /* # of splits in each direction */
int domainCoords[3];                          /* index # of domain in each direction */
MPI_Comm cartComm;                            /* MPI_Comm for cartesian topology */

long NumPartsInDomain = 0;                    /* number of parts in ThisTask's domain */
long NumParts = 0;                            /* number of particles for ThisTask */
float *PartsPx = NULL;                        /* particle x position */
float *PartsPy = NULL;                        /* particle y position */
float *PartsPz = NULL;                        /* particle z position */
float *PartsVx = NULL;                        /* particle x velocity */
float *PartsVy = NULL;                        /* particle y velocity */
float *PartsVz = NULL;                        /* particle z velocity */
short int *PartsInDomainMark = NULL;          /* marks if a particle is in the domain or a buffer particle */
kdTreeData *PartskdTreeData = NULL;           /* kdTree data struct for particles */

long NumHalos = 0;                            /* number of halos for ThisTask */
Halo *Halos = NULL;                           /* halos for ThisTask */
MPI_Datatype MPI_Halo;                        /* MPI halo data type */
